<?php defined('IN_PHPCMS') or exit('Access Denied'); ?><?php include template('yp','center_header'); ?>
<style type="text/css">
<!--
.span_color {
line-height: 19px;height:19px;float:left;width:30px;padding-left:16px;display:block;padding-top:5px;*line-height:22px;*height:22px;*width:34px;*padding-left:10px;*padding-top:0px;}
-->
</style>
<div id="main">
<?php include template("yp","center_left"); ?>

<?php if($action=='answer') { ?>
<div id="right">
<table cellpadding="0" cellspacing="1" class="table_form">
<caption>详细信息</caption>
<?php if($info[id]) { ?>
<tr> 
      <th width="20%"><strong>询价对象：</strong>
  </th>
      <td><?php echo $title;?> </td>
    </tr>
<tr> 
      <th width="20%"><strong>询价页面：</strong>
  </th>
      <td><a href="<?php echo $info['forwardpage'];?>"><?php echo $info['forwardpage'];?></a> </td>
    </tr>
<?php } ?>
<tr> 
      <th width="20%"><strong>姓名：</strong>
  </th>
      <td><?php echo $info['username'];?> </td>
    </tr>
<tr> 
      <th width="20%"><strong>所在单位：</strong>
  </th>
      <td><?php echo $info['unit'];?> </td>
    </tr>
<?php if($info[fax]) { ?>
<tr> 
      <th width="20%"><strong>公司传真：</strong>
  </th>
      <td><?php echo $info['fax'];?> </td>
    </tr>
<?php } ?>
<tr> 
      <th width="20%"><strong>联系电话：</strong>
  </th>
      <td><?php echo $info['telephone'];?> </td>
    </tr>
<?php if($info[qq]) { ?>
<tr> 
      <th width="20%"><strong>QQ：</strong>
  </th>
      <td><?php echo $info['qq'];?> </td>
    </tr>
<?php } ?>
<?php if($info[msn]) { ?>
<tr> 
      <th width="20%"><strong>MSN：</strong>
  </th>
      <td><?php echo $info['msn'];?> </td>
    </tr>
<?php } ?>
<tr> 
      <th width="20%"><strong>Email：</strong>
  </th>
      <td><?php echo $info['email'];?> </td>
    </tr>
<tr> 
      <th width="20%"><strong>留言内容：</strong>
  </th>
      <td><?php echo $info['content'];?> </td>
    </tr>
<form action="<?php echo URL;?>" method="post" name="myform"  enctype="multipart/form-data" >
<tr> 
      <th width="20%"><strong>标记该留言：</strong>
  </th>
      <td>
<span class="span_color bg14"><input type="radio" name="style" value="c14" > </span>
<span class="span_color bg12"><input type="radio" name="style" value="c12" > </span>
<span class="span_color bg13"><input type="radio" name="style" value="c13" > </span>
<span class="span_color bg3"><input type="radio" name="style" value="c3" > </span>
<span class="span_color bg6"><input type="radio" name="style" value="c6" > </span>
<span class="span_color bg8"><input type="radio" name="style" value="c8" > </span>
  </td>
    </tr>
<tr> 
      <td></td>
      <td> 
  <input type="hidden" name="forward" value="<?php echo $forward;?>"> 
  <input type="hidden" name="id" value="<?php echo $info['gid'];?>"> 
  <input type="submit" name="dosubmit" value=" 确定 "> 
  </td>
    </tr>
</form>
</table>

</div>
<?php } else { ?>
  <div id="right">
<div class="clear"></div>
<table cellpadding="0" cellspacing="1" class="table_list">
  <caption>管理留言</caption>
  <tr>
<th width="30"><input type="checkbox" onclick="javascript:checkall(this)"/></th>
<th>留言摘要</th>
<th width="100">留言人</th>
<th width="110">留言时间</th>
<th width="50">状态</th>
<th width="130">操作</th>
  </tr>
<?php if(is_array($infos)) foreach($infos AS $info) { ?>
<tr>
<th width="30"><input type="checkbox" name="gid[]" value="<?php echo $info['gid'];?>"/></th>
<td class="align_left">
<a href="javascript:showMsgCnt('<?php echo $info['gid'];?>'<?php if($info[status] == 0) { ?>,false<?php } else { ?>,true<?php } ?>)"><span class="<?php echo $info['style'];?>"><?php echo str_cut($info[content],150,'...');?></span></a>
</td>
<td><?php echo $info['username'];?></td>
<td><?php echo date('Y-m-d H:i',$info[addtime]);?></td>
<td><?php if($info[status]==0) { ?><font color="red">未读</font><?php } else { ?><font color="#009900">已读</font><?php } ?></td>
<td><a href="<?php echo BUSINESSDIR;?>?file=<?php echo $file;?>&action=answer&id=<?php echo $info['gid'];?>">详情</a><?php if($info[vid]) { ?> | <a href="<?php echo $MODULE['message']['url'];?>send.php?userid=<?php echo $info['vid'];?>" target="_blank" title="短消息">短消息</a><?php } ?> | <a href="javascript:confirmurl('<?php echo BUSINESSDIR;?>?file=<?php echo $file;?>&action=delete&gid=<?php echo $info['gid'];?>','确认删除此留言吗？')">删除</a></td>
</tr>	
<tr id="cnt<?php echo $info['gid'];?>" style="display:none">			
<td colspan="6" class="align_left"><p><?php echo $info['content'];?></p></td>
</tr>
<?php } ?>
<tr>
<th width="30"><input type="checkbox" onclick="javascript:checkall(this)"/></th>
<td colspan="5" class="align_left"><input type="button" value="删除所选" onclick="javascript:buttondo(true)"/> <input type="button" value="标记为已读" onclick="javascript:buttondo(false)"/></td>
</tr>
</table>
<div id="pages"><?php echo $pages;?></div>
<table cellpadding="0" cellspacing="1" class="table_info">
  <caption>
  提示信息
  </caption>
  <tr>
<td> 您可以通过标记不同的颜色来区分留意的重要性。
<br/>
</td>
  </tr>
</table>
  </div>
<?php } ?>
</div>
<div class="clear"></div>
<script>
var showMsgCnt = function(obj,bool)
{
var c= obj;
obj = 'cnt'+obj;

var t = $("#"+obj);
if(!bool)$.get('<?php echo BUSINESSDIR;?>?file=<?php echo $file;?>&action=answer&id='+c);
if(t.css("display") != "none")t.hide();
else t.show();
}

var checkall = function(obj)
{
$("input[name='gid[]']").attr('checked',obj.checked);
}

var buttondo = function(bool)
{
var par;
if(bool)
{
par = 'batmethod=delete';
}
else
{
par = 'batmethod=bookmark';
}
$("input[name='gid[]']").each(function(){ if(this.checked)par += '&gid[]='+this.value});
$.get('<?php echo BUSINESSDIR;?>?file=<?php echo $file;?>&action=batdo&'+par+'&jsrand='+Math.random(),function(data){ if(data=='ok')window.location.reload();});
}
</script>
<?php include template('phpcms','footer'); ?>